// for (i = 0; i < 20; i++) {
   
    
   


// for (i = 0; i < 20; i++) {
    "auto";
    var num;
    function random_down_swp(){
        toast("开始下一页");
        sleep(2000);
        swipe(520,1800 ,520 ,1400,500 );
        sleep(1000);
        swipe(520,1910 ,520 ,5,1500 );
        sleep(2000);
        }
    function bak_go(){
      click(50,140); 
      sleep(2000); 
      id("tv_fans").findOnce().click();
      num=num+1;
    }
    while(true){
        id("iv_follow").click();
        sleep(3000);
        let i=0,j=0;
        while(true){
            
            let object = text("关注成功").findOnce(); 
            if(object !=null){
                click(500, 1280);
                sleep(500);
                j=1;
                
            }else{
                i=i+1;
                if (i>=20){
                    i=0;
                    break;
                }
            }
            
        }
        if (j==1){
            bak_go();
        }
        
        random_down_swp();
    }
    

    // toast("开始下一页");
    // sleep(2000);
    // swipe(520,1920 ,520 ,0,1500 );
    // sleep(2000);

// }